﻿using Rougamo;
using Rougamo.Context;

namespace HZY.Repository.EntityFramework.Aop;

[AttributeUsage(AttributeTargets.Class)]
public class DictMoAttribute : MoAttribute
{
    //private readonly List<DictInfo> dictInfos;
    public string DictInfos;

    public DictMoAttribute()
    {

    }

    public DictMoAttribute(params DictInfo[] dic)
    {

    }

    //public DictMoAttribute(List<DictInfo> dictInfos)
    //{
    //    this.dictInfos = new List<DictInfo>(dictInfos);
    //}

    public override void OnEntry(MethodContext context)
    {
        // 从context对象中能取到包括入参、类实例、方法描述等信息
        //Log.Info("方法执行前");
    }

    public override void OnException(MethodContext context)
    {
        //Log.Error("方法执行异常", context.Exception);
    }

    public override void OnSuccess(MethodContext context)
    {
        //Log.Info("方法执行成功后");
    }

    public override void OnExit(MethodContext context)
    {
        //Log.Info("方法退出时，不论方法执行成功还是异常，都会执行");
    }
}
